<?php

	include("includes/connect.php");

?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Bootstrap, from Twitter</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Le styles -->
    <link href="./bootstrap/css/bootstrap.css" rel="stylesheet">
    <style type="text/css">
      body {
        padding-top: 60px;
        padding-bottom: 40px;
      }
    </style>
    <link href="./bootstrap/css/bootstrap-responsive.css" rel="stylesheet">

    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
      <script src="./bootstrap/js/html5shiv.js"></script>
    <![endif]-->

    <!-- Fav and touch icons -->
    <link rel="apple-touch-icon-precomposed" sizes="144x144" href="./bootstrap/ico/apple-touch-icon-144-precomposed.png">
    <link rel="apple-touch-icon-precomposed" sizes="114x114" href="./bootstrap/ico/apple-touch-icon-114-precomposed.png">
      <link rel="apple-touch-icon-precomposed" sizes="72x72" href="./bootstrap/ico/apple-touch-icon-72-precomposed.png">
                    <link rel="apple-touch-icon-precomposed" href="./bootstrap/ico/apple-touch-icon-57-precomposed.png">
                                   <link rel="shortcut icon" href="./bootstrap/ico/favicon.png">
	   <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="bootstrap/js/jquery.js"></script>
	<script src="bootstrap/js/bootstrap.min.js"></script>
	<script src="bootstrap/js/jqBootstrapValidation.js"></script>

	<link rel="stylesheet" href="jquery-ui/themes/base/jquery-ui.css" />
  <script src="jquery-ui/ui/jquery-ui.js"></script>

	<script type="text/javascript">

	$(document).ready(function(){

		$("input,select,textarea").not("[type=submit]").jqBootstrapValidation();

		$('#myTab a').click(function (e) {
		  e.preventDefault();

		  //alert($(this).attr('href'));
		  var tab = $(this).attr('href');
		  $("#itab").val(tab);
		  //document.getElementById('itab').value=tab;
		  $(this).tab('show');
		  
		});

		//$('#myTab a:last').tab('show');
		$('#action').click(function() {
			//$('#myTab li:eq(2) a').tab('show');
		  //var tab = $(this).attr('href');
		  $("#itab").val('#profile');

			$('#myTab a[href="#profile"]').tab('show');
		});

		 $("#messages").click(function() {
            //alert("asdfsd");
			$.ajax({

				url: "modal.php",
				cach: false,
				error: function() {
				   alert('Error!');
				},
				success: function(data){
					//alert(data);
					//window.location.href="index.php";
					//document.getElementById('xxx').innerHTML = data;
					$("#container").after(data);
					$('#myModal').modal({
					  keyboard: false
					});
					

				}
	        });		
		});

		$( "#datepicker" ).val("12/31/2013");
		$( "#datepicker" ).datepicker({
			showButtonPanel: true
		 });

		$( "#kob" ).click(function() {
			//alert("kob");
			$.ajax({
				type: "POST",
				url: "display.php",
				cach: false,
				error: function() {
				   alert('Error!');
				},
				success: function(data){
					//alert(data);
					//window.location.href="index.php";
					$("#display").after(data);

				}
			});
		 });

	});


	</script>

  </head>

  <body>
	
    <div class="navbar navbar-inverse navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="brand" href="#">Project name</a>
          <div class="nav-collapse collapse">
            <ul class="nav">
              <li class="active"><a href="#">Home</a></li>
              <li><a href="#about">About</a></li>
              <li><a href="#contact">Contact</a></li>
              <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
                <ul class="dropdown-menu">
                  <li><a href="#" >Profile</a></li>
                  <li><a href="#" >Messages</a></li>
                  <li><a href="#">Settings</a></li>
                  <li class="divider"></li>
                  <li class="nav-header">Nav header</li>
                  <li><a href="#">Separated link</a></li>
                  <li><a href="#">One more separated link</a></li>
                </ul>
              </li>
            </ul>
            <form class="navbar-form pull-right">
              <input class="span2" type="text" placeholder="Email">
              <input class="span2" type="password" placeholder="Password">
              <button type="submit" class="btn">Sign in</button>
            </form>
          </div><!--/.nav-collapse -->
        </div>
      </div>
    </div>

    <div class="container" id="container">

     

      <!-- Example row of columns -->
      <div class="row-fluid">
        <div class="span12">
		  <div class="tabbable"> <!-- Only required for left/right tabs -->
			  <ul class="nav nav-tabs">
				<li class="active"><a href="#tab1" data-toggle="tab">Section 1</a></li>
				<li><a href="#tab2" data-toggle="tab">Section 2</a></li>
			  </ul>
			  <div class="tab-content">
				<div class="tab-pane active" id="tab1">
				  <p>I'm in Section 1.</p>
				  <form class="form-horizontal" action="modal.php" method="post" novalidate="">

					  <div class="control-group">
						<label class="control-label">Email address</label>
						<div class="controls ">
						  <input type="email" required /><div class="help-inline help-block"></div>
						</div>
					  </div>
					  <div class="control-group">
						<label class="control-label">Quality Control</label>
						<div class="controls">
                                <label class="checkbox inline">
                                    <input type="checkbox" name="qualityControl[]" value="fast" data-validation-minchecked-minchecked="2" data-validation-minchecked-message="Choose two" data-validation-maxchecked-maxchecked="2" data-validation-maxchecked-message="You can't have it all ways" aria-invalid="false">
                                    Fast
                                </label>
                                <label class="checkbox inline">
                                    <input type="checkbox" name="qualityControl[]" value="cheap" aria-invalid="false">
                                    Cheap
                                </label>
                                <label class="checkbox inline">
                                    <input type="checkbox" name="qualityControl[]" value="good" aria-invalid="false">
                                    Good
                                </label>
                                <div class="help-inline help-block"></div>
                            </div>

					</div>
						<input type="hidden" id="itab" name="itab" value="">
					  <button class="btn btn-large btn-primary" type="submit">ลงชื่อเข้าใช้งาน</button>
					  <button type="submit" class="btn btn-primary">Test Validation <i class="icon-ok icon-white"></i></button>
					</form>

				  
				</div>
				<div class="tab-pane" id="tab2">
				  <p>Howdy, I'm in Section 2.</p>
				  Date: <input type="text" id="datepicker" />

				</div>
			  </div>
			</div>
		</div>
        
        
      </div>
		 <div class="row">
			  <div class="span12">
			  <ul class="nav nav-tabs" id="myTab">
				  <li class="active"><a href="#home">Home</a></li>
				  <li><a href="#profile">Profile</a></li>
				  <li><a href="#messages">Messages</a></li>
				  <li><a href="#settings">Settings</a></li>
				</ul>
				 
				<div class="tab-content">
				  <div class="tab-pane active" id="home"><input class="span3" type="email" required></div>
				  <div class="tab-pane" id="profile">
					</div>
				  <div class="tab-pane" id="messages"><a href="#" id="kob">Load Data</a>
				  <div id="display"></div></div>
				  <div class="tab-pane" id="settings">...</div>
				</div>
			</div>
		</div>

		<div id="xxx"></div>

      <hr>

      <footer>
        <p>&copy; Company 2013</p>
      </footer>

    </div> <!-- /container -->

 
  </body>
</html>
